package cn.edu.nju.software.AtoB;

/**
 *
 * @author zf
 */
import java.rmi.Naming;
public class Client {
//查找远程对象并调用远程方法
        public static void main(String[] args) {
		try {
//从另一台启动了RMI注册服务的机器上查找hello实例
			Agent a = (Agent) Naming.lookup("rmi:/127.0.0.1:1099/Agent");
			//调用远程方法
			ConsumerIntf ci = a.getConsumer("jiba","mao");
			System.out.println(ci.getAddress());
                        System.out.println(ci.getDeliverMethod());
		} catch (Exception e) {
			e.printStackTrace();
		}
        }
}


